In any image or video coding schemes, quantization is an important step to compress data by eliminating a part of information in an image or video. Quantization is usually executed in a transform domain so that information loss in quantization processing enables an image or data to be more appropriately compressed.
In most of the image or video coding schemes, quantization processing can be controlled using quantization parameters. At this time, the greater a value of a quantization parameter is, the greater the amount of compression is, which results in a greater information loss, and vice versa.
In some of the image or video coding schemes, quantization processing and inverse quantization processing can also be controlled using quantization scaling matrixes, rather than quantization parameters. Here, each frequency coefficient in a two-dimensionally transformed block can be quantized using both a quantization parameter and one corresponding quantization scaling matrix. For example, Patent Literature (PTL) 1 describes a video coding apparatus which codes video using quantization scaling matrixes.
Quantization processing and inverse quantization processing can also be controlled using quantization offset matrixes. It should be noted that the term “quantization matrix” is used in the following when a quantization scaling matrix and a quantization offset matrix do not need to be distinguished in particular.
An example of inverse quantization processing can be represented by the following expression.AbsCoeff[i][j]=((abs(QuantizedCoeff[i][j])<<7)−Offset[i][j])*LevelScale*QMatrix[i][j]>>QShift
Here, LevelScale and QShift are controlled using a quantization parameter, QMatrix[i][j] is a quantization scaling matrix, and Offset[i][j] is a quantization offset matrix.
A quantization parameter, a quantization scaling matrix, and a quantization offset matrix are coded in compressed data, and used in an inverse quantization step included in decoding processing for reconstructing an image or video.
In a video encoding scheme such as ISO/IEC 14496-10 (MPEG-4 AVC), a quantization scaling matrix can be coded in the header of a sequence or a picture. When a quantization scaling matrix is coded in the header of a sequence, inverse quantization processing will be performed on all pictures in the same sequence using this quantization scaling matrix, unless other quantization scaling matrixes are coded for the pictures. When a quantization scaling matrix is coded in the header of a picture, inverse quantization processing will be performed on the picture using the quantization scaling matrix coded in the picture header.
It should be noted that in the ISO/IEC 14496-10 (MPEG-4 AVC) coding scheme, for luminance samples, a quantization scaling matrix coded in a sequence header is used for inverse quantization processing when a quantization scaling matrix is not coded in a picture header. However, for chrominance samples, a quantization scaling matrix for luminance samples is used for inverse quantization processing on a picture when a quantization scaling matrix is not coded in the header of the picture.